#include "stdafx.h"
#include "core/window.h"
#include "core/coreinitializer.h"

#include <SDL/SDL_syswm.h>
#include <string.h>

static
bool userWantsFullscreen(int argc, char* argv[])
{
    if (argc > 1)
    {
        const char* option = argv[1];
        if (!strcmp(option, "-fullscreen"))
        {
            return true;
        }
        if (!strcmp(option, "-window"))
        {
            return false;
        }
    }
    return false;
}

int main(int argc, char* argv[])
{
    // Do you want use fullscreen?
    bool needFullscreen = userWantsFullscreen(argc, argv);

    Core::CoreInitializer initializer;
    initializer.init(needFullscreen);
    {
        Core::Window* w = Core::Window::instance();
        w->init();
        w->show();
        w->enterLoop();
    }
    initializer.destroy();

    return 0;
}
